function plotlyFont = matlab2plotlyfont(matlabFont)
    % Common MATLAB fonts mapped to Plotly fonts

    persistent fontMap
    % Initialize the font map once
    if isempty(fontMap)
        fontMap = getFontMap();
    end

    if fontMap.isKey(matlabFont)
        plotlyFont = fontMap(matlabFont);
    else
        plotlyFont = "Open Sans, sans-serif";
    end
end

function fontMap = getFontMap()
    fontMap = containers.Map();
    % availableFont = {"Arial, sans-serif",  "Balto, sans-serif" , ...
    %     "Courier New, monospace" , "Droid Sans, sans-serif" ,...
    %     "Droid Serif, serif",  "Droid Sans Mono, sans-serif", ...
    %     "Georgia, serif" ,  "Gravitas One, cursive" ,  ...
    %     "Old Standard TT, serif" ,  "Open Sans, sans-serif", ...
    %     "PT Sans Narrow, sans-serif" , "Raleway, sans-serif",...
    %     "Times New Roman, Times, serif"};
    fontMap("Abadi MT Condensed Extra Bold") = "Arial, sans-serif";
    fontMap("Abadi MT Condensed Light") = "Balto, sans-serif";
    fontMap("Adobe Arabic") = "Times New Roman, Times, serif";
    fontMap("Adobe Caslon Pro") = "Times New Roman, Times, serif";
    fontMap("Adobe Fan Heiti Std") = "Arial, sans-serif";
    fontMap("Adobe Fangsong Std") = "Times New Roman, Times, serif";
    fontMap("Adobe Garamond Pro") = "Times New Roman, Times, serif";
    fontMap("Adobe Gothic Std") = "Arial, sans-serif";
    fontMap("Adobe Hebrew") = "Times New Roman, Times, serif";
    fontMap("Adobe Heiti Std") = "Droid Sans, sans-serif";
    fontMap("Adobe Kaiti Std") = "Times New Roman, Times, serif";
    fontMap("Adobe Ming Std") = "Times New Roman, Times, serif";
    fontMap("Adobe Myungjo Std") = "Old Standard TT, serif";
    fontMap("Adobe Song Std") = "Times New Roman, Times, serif";
    fontMap("Al Bayan") = "Balto, sans-serif";
    fontMap("American Typewriter") = "Old Standard TT, serif";
    fontMap("Andale Mono") = "Droid Sans, sans-serif";
    fontMap("Apple Braille") = "Balto, sans-serif";
    fontMap("Apple Chancery") = "Old Standard TT, serif";
    fontMap("Apple Color Emoji") = "Balto, sans-serif";
    fontMap("Apple LiGothic") = "Arial, sans-serif";
    fontMap("Apple LiSung") = "Times New Roman, Times, serif";
    fontMap("Apple Symbols") = "Balto, sans-serif";
    fontMap("Apple Gothic") = "Balto, sans-serif";
    fontMap("Apple Myungjo") = "Old Standard TT, serif";
    fontMap("Arial") = "Arial, sans-serif";
    fontMap("Arial Black") = "Arial, sans-serif";
    fontMap("Arial Hebrew") = "Arial, sans-serif";
    fontMap("Arial Narrow") = "Arial, sans-serif";
    fontMap("Arial Rounded MT Bold") = "Arial, sans-serif";
    fontMap("Arial Unicode MS") = "Arial, sans-serif";
    fontMap("Ayuthaya") = "Balto, sans-serif";
    fontMap("Baghdad") = "Balto, sans-serif";
    fontMap("Bangla MN") ="Raleway, sans-serif";
    fontMap("Bangla Sangam MN") ="Raleway, sans-serif";
    fontMap("Baskerville") = "Times New Roman, Times, serif";
    fontMap("Baskerville Old Face") = "Times New Roman, Times, serif";
    fontMap("Batang") = "Courier New, monospace";
    fontMap("Bauhaus 93") = "Gravitas One, cursive";
    fontMap("Bell MT") = "Times New Roman, Times, serif";
    fontMap("Bernard MT Condensed") = "Gravitas One, cursive";
    fontMap("BiauKai") = "Courier New, monospace";
    fontMap("Big Caslon") = "Times New Roman, Times, serif";
    fontMap("Birch Std") = "Droid Serif, serif";
    fontMap("Blackoak Std") = "Gravitas One, cursive";
    fontMap("Book Antiqua") = "Droid Serif, serif";
    fontMap("Bookman Old Style") = "Balto, sans-serif";
    fontMap("Bookshelf Symbol 7") = "Gravitas One, cursive";
    fontMap("Braggadocio") = "Gravitas One, cursive";
    fontMap("Britannic Bold") = "Courier New, monospace";
    fontMap("Brush Script MT") = "Courier New, monospace";
    fontMap("Brush Script Std") = "Courier New, monospace";
    fontMap("Calibri") = "Balto, sans-serif";
    fontMap("Calisto MT") = "Times New Roman, Times, serif";
    fontMap("Cambria") = "Times New Roman, Times, serif";
    fontMap("Cambria Math") = "Times New Roman, Times, serif";
    fontMap("Candara") = "Raleway, sans-serif";
    fontMap("Century") = "Times New Roman, Times, serif";
    fontMap("Century Gothic") = "Balto, sans-serif";
    fontMap("Century Schoolbook") = "Times New Roman, Times, serif";
    fontMap("Chalkboard") = "Droid Sans, sans-serif";
    fontMap("Chalkduster") = "Droid Sans, sans-serif";
    fontMap("Chaparral Pro") = "Droid Serif, serif";
    fontMap("Charcoal CY") = "Arial, sans-serif";
    fontMap("Charlemagne Std") = "Old Standard TT, serif";
    fontMap("Cochin") = "Old Standard TT, serif";
    fontMap("Colonna MT") = "Times New Roman, Times, serif";
    fontMap("Comic Sans MS") = "Droid Sans, sans-serif";
    fontMap("Consolas") = "Balto, sans-serif";
    fontMap("Constantia") = "Times New Roman, Times, serif";
    fontMap("Cooper Black") = "Droid Sans, sans-serif";
    fontMap("Cooper Std") = "Droid Sans, sans-serif";
    fontMap("Copperplate") = "Old Standard TT, serif";
    fontMap("Copperplate Gothic Bold") = "Old Standard TT, serif";
    fontMap("Copperplate Gothic Light") = "Droid Serif, serif";
    fontMap("Corbel") = "PT Sans Narrow, sans-serif";
    fontMap("Corsiva Hebrew") = "Gravitas One, cursive";
    fontMap("Courier") = "Courier New, monospace";
    fontMap("Courier New") = "Courier New, monospace";
    fontMap("Curlz MT") = "Gravitas One, cursive";
    fontMap("Damascus") = "Arial, sans-serif";
    fontMap("DecoType Naskh") = "Balto, sans-serif";
    fontMap("Desdemona") = "Gravitas One, cursive";
    fontMap("Devanagari MT") = "Old Standard TT, serif";
    fontMap("Devanagari Sangam MN") = "Balto, sans-serif";
    fontMap("Dialog") = "Raleway, sans-serif";
    fontMap("DialogInput") = "Balto, sans-serif";
    fontMap("Didot") = "Times New Roman, Times, serif";
    fontMap("Edwardian Script ITC") = "Gravitas One, cursive";
    fontMap("Engravers MT") = "Droid Serif, serif";
    fontMap("Euphemia UCAS") = "Arial, sans-serif";
    fontMap("Eurostile") = "Droid Sans, sans-serif";
    fontMap("Footlight MT Light") = "Old Standard TT, serif";
    fontMap("Franklin Gothic Book") = "Balto, sans-serif";
    fontMap("Franklin Gothic Medium") = "Arial, sans-serif";
    fontMap("Futura") = "Droid Sans, sans-serif";
    fontMap("Gabriola") = "Gravitas One, cursive";
    fontMap("Garamond") = "Times New Roman, Times, serif";
    fontMap("GB18030 Bitmap") = "Arial, sans-serif";
    fontMap("Geeza Pro") = "Balto, sans-serif";
    fontMap("Geneva") = "Balto, sans-serif";
    fontMap("Geneva CY") = "Arial, sans-serif";
    fontMap("Georgia") = "Old Standard TT, serif";
    fontMap("Giddyup Std") = "Gravitas One, cursive";
    fontMap("Gill Sans") = "Arial, sans-serif";
    fontMap("Gill Sans MT") = "Arial, sans-serif";
    fontMap("Gill Sans Ultra Bold") = "Arial, sans-serif";
    fontMap("Gloucester MT Extra Condensed") = "Droid Sans, sans-serif";
    fontMap("Goudy Old Style") = "Times New Roman, Times, serif";
    fontMap("Gujarati MT") = "Times New Roman, Times, serif";
    fontMap("Gujarati Sangam MN") = "Balto, sans-serif";
    fontMap("Gulim") = "Balto, sans-serif";
    fontMap("GungSeo") = "Old Standard TT, serif";
    fontMap("Gurmukhi MN") = "PT Sans Narrow, sans-serif";
    fontMap("Gurmukhi MT") = "PT Sans Narrow, sans-serif";
    fontMap("Haettenschweiler") = "Arial, sans-serif";
    fontMap("Harrington") = "Gravitas One, cursive";
    fontMap("HeadLineA") = "Arial, sans-serif";
    fontMap("Hei") = "Balto, sans-serif";
    fontMap("Heiti SC") = "Balto, sans-serif";
    fontMap("Heiti TC") = "Balto, sans-serif";
    fontMap("Helvetica") = "Arial, sans-serif";
    fontMap("Helvetica CY") = "Arial, sans-serif";
    fontMap("Helvetica Neue") = "Arial, sans-serif";
    fontMap("Herculanum") = "Gravitas One, cursive";
    fontMap("Hiragino Kaku Gothic Pro") = "Balto, sans-serif";
    fontMap("Hiragino Kaku Gothic ProN") = "Balto, sans-serif";
    fontMap("Hiragino Kaku Gothic Std") = "Balto, sans-serif";
    fontMap("Hiragino Kaku Gothic StdN") = "Balto, sans-serif";
    fontMap("Hiragino Maru Gothic Pro") = "Balto, sans-serif";
    fontMap("Hiragino Maru Gothic ProN") = "Balto, sans-serif";
    fontMap("Hiragino Mincho Pro") = "Times New Roman, Times, serif";
    fontMap("Hiragino Mincho ProN") = "Times New Roman, Times, serif";
    fontMap("Hiragino Sans GB") = "Balto, sans-serif";
    fontMap("Hobo Std") = "Droid Sans, sans-serif";
    fontMap("Hoefler Text") = "Times New Roman, Times, serif";
    fontMap("Impact") = "Arial, sans-serif";
    fontMap("Imprint MT Shadow") = "Arial, sans-serif";
    fontMap("InaiMathi") = "Balto, sans-serif";
    fontMap("Kai") = "Times New Roman, Times, serif";
    fontMap("Kailasa") = "Arial, sans-serif";
    fontMap("Kannada MN") = "PT Sans Narrow, sans-serif";
    fontMap("Kannada Sangam MN") = "Open Sans, sans-serif";
    fontMap("Kefa") = "Arial, sans-serif";
    fontMap("Khmer MN") = "Balto, sans-serif";
    fontMap("Khmer Sangam MN") = "Balto, sans-serif";
    fontMap("Kino MT") = "Old Standard TT, serif";
    fontMap("Kokonor") = "Gravitas One, cursive";
    fontMap("Kozuka Gothic Pr6N") = "Arial, sans-serif";
    fontMap("Kozuka Gothic Pro") = "Arial, sans-serif";
    fontMap("Kozuka Mincho Pr6N") = "Times New Roman, Times, serif";
    fontMap("Kozuka Mincho Pro") = "Times New Roman, Times, serif";
    fontMap("Krungthep") = "Arial, sans-serif";
    fontMap("KufiStandardGK") = "Arial, sans-serif";
    fontMap("Lao MN") = "PT Sans Narrow, sans-serif";
    fontMap("Lao Sangam MN") = "Balto, sans-serif";
    fontMap("Letter Gothic Std") = "Courier New, monospace";
    fontMap("LiHei Pro") = "Arial, sans-serif";
    fontMap("LiSong Pro") = "Courier New, monospace";
    fontMap("Lithos Pro") = "Gravitas One, cursive";
    fontMap("Lucida Blackletter") = "Gravitas One, cursive";
    fontMap("Lucida Bright") = "Gravitas One, cursive";
    fontMap("Lucida Calligraphy") = "Gravitas One, cursive";
    fontMap("Lucida Console") = "Balto, sans-serif";
    fontMap("Lucida Fax") = "Old Standard TT, serif";
    fontMap("Lucida Grande") = "Balto, sans-serif";
    fontMap("Lucida Handwriting") = "Gravitas One, cursive";
    fontMap("Lucida Sans") = "Arial, sans-serif";
    fontMap("Lucida Sans Typewriter") = "Arial, sans-serif";
    fontMap("Lucida Sans Unicode") = "Balto, sans-serif";
    fontMap("Malayalam MN") = "PT Sans Narrow, sans-serif";
    fontMap("Malayalam Sangam MN") = "Balto, sans-serif";
    fontMap("Marker Felt") = "Gravitas One, cursive";
    fontMap("Marlett") = "Arial, sans-serif";
    fontMap("Matura MT Script Capitals") = "Gravitas One, cursive";
    fontMap("Meiryo") = "Balto, sans-serif";
    fontMap("Menlo") = "Balto, sans-serif";
    fontMap("Mesquite Std") = "Gravitas One, cursive";
    fontMap("Microsoft Sans Serif") = "Open Sans, sans-serif";
    fontMap("Minion Pro") = "Times New Roman, Times, serif";
    fontMap("Mistral") = "Gravitas One, cursive";
    fontMap("Modern No. 20") = "Times New Roman, Times, serif";
    fontMap("Monaco") = "Arial, sans-serif";
    fontMap("Monospaced") = "Times New Roman, Times, serif";
    fontMap("Monotype Corsiva") = "Gravitas One, cursive";
    fontMap("Monotype Sorts") = "Balto, sans-serif";
    fontMap("MS Gothic") = "Balto, sans-serif";
    fontMap("MS Mincho") = "Courier New, monospace";
    fontMap("MS PGothic") = "Arial, sans-serif";
    fontMap("MS PMincho") = "Times New Roman, Times, serif";
    fontMap("MS Reference Sans Serif") = "Arial, sans-serif";
    fontMap("MS Reference Specialty") = "Balto, sans-serif";
    fontMap("Mshtakan") = "Times New Roman, Times, serif";
    fontMap("MT Extra") = "Arial, sans-serif";
    fontMap("Myanmar MN") = "PT Sans Narrow, sans-serif";
    fontMap("Myanmar Sangam MN") = "Balto, sans-serif";
    fontMap("Myriad Pro") = "Arial, sans-serif";
    fontMap("Nadeem") = "Arial, sans-serif";
    fontMap("Nanum Brush Script") = "Gravitas One, cursive";
    fontMap("Nanum Gothic") = "Arial, sans-serif";
    fontMap("Nanum Myeongjo") = "Times New Roman, Times, serif";
    fontMap("Nanum Pen Script") = "Gravitas One, cursive";
    fontMap("New Peninim MT") = "Gravitas One, cursive";
    fontMap("News Gothic MT") = "Arial, sans-serif";
    fontMap("Noteworthy") = "Gravitas One, cursive";
    fontMap("Nueva Std") = "Gravitas One, cursive";
    fontMap("OCR A Std") = "Old Standard TT, serif";
    fontMap("Onyx") = "PT Sans Narrow, sans-serif";
    fontMap("Optima") = "Droid Serif, serif";
    fontMap("Orator Std") = "PT Sans Narrow, sans-serif";
    fontMap("Oriya MN") = "PT Sans Narrow, sans-serif";
    fontMap("Oriya Sangam MN") = "Balto, sans-serif";
    fontMap("Osaka") = "Arial, sans-serif";
    fontMap("Palatino") = "Old Standard TT, serif";
    fontMap("Palatino Linotype") = "Old Standard TT, serif";
    fontMap("Papyrus") = "Gravitas One, cursive";
    fontMap("PCMyungjo") = "Courier New, monospace";
    fontMap("Perpetua") = "Droid Serif, serif";
    fontMap("Perpetua Titling MT") = "Times New Roman, Times, serif";
    fontMap("PilGi") = "Gravitas One, cursive";
    fontMap("Plantagenet Cherokee") = "Times New Roman, Times, serif";
    fontMap("Playbill") = "Arial, sans-serif";
    fontMap("PMingLiU") = "Courier New, monospace";
    fontMap("Poplar Std") = "Arial, sans-serif";
    fontMap("Prestige Elite Std") = "Courier New, monospace";
    fontMap("PT Sans") = "PT Sans Narrow, sans-serif";
    fontMap("PT Sans Caption") = "Arial, sans-serif";
    fontMap("PT Sans Narrow") = "PT Sans Narrow, sans-serif";
    fontMap("Raanana") = "Times New Roman, Times, serif";
    fontMap("Rockwell") = "Droid Serif, serif";
    fontMap("Rockwell Extra Bold") = "Droid Serif, serif";
    fontMap("Rosewood Std") = "Droid Serif, serif";
    fontMap("SansSerif") = "Open Sans, sans-serif";
    fontMap("Sathu") = "Arial, sans-serif";
    fontMap("Serif") = "Times New Roman, Times, serif";
    fontMap("Silom") = "Arial, sans-serif";
    fontMap("SimSun") = "Courier New, monospace";
    fontMap("Sinhala MN") = "Balto, sans-serif";
    fontMap("Sinhala Sangam MN") = "Balto, sans-serif";
    fontMap("Skia") = "Raleway, sans-serif";
    fontMap("Stencil") = "Old Standard TT, serif";
    fontMap("Stencil Std") = "Old Standard TT, serif";
    fontMap("STFangsong") = "Times New Roman, Times, serif";
    fontMap("STHeiti") = "Balto, sans-serif";
    fontMap("STIXGeneral") = "Times New Roman, Times, serif";
    fontMap("STIXIntegralsD") = "Arial, sans-serif";
    fontMap("STIXIntegralsSm") = "Arial, sans-serif";
    fontMap("STIXIntegralsUp") = "Arial, sans-serif";
    fontMap("STIXIntegralsUpD") = "Arial, sans-serif";
    fontMap("STIXIntegralsUpSm") = "Arial, sans-serif";
    fontMap("STIXNonUnicode") = "Arial, sans-serif";
    fontMap("STIXSizeFiveSym") = "Arial, sans-serif";
    fontMap("STIXSizeFourSym") = "Arial, sans-serif";
    fontMap("STIXSizeOneSym") = "Arial, sans-serif";
    fontMap("STIXSizeThreeSym") = "Arial, sans-serif";
    fontMap("STIXSizeTwoSym") = "Arial, sans-serif";
    fontMap("STIXVariants") = "Arial, sans-serif";
    fontMap("STKaiti") = "Times New Roman, Times, serif";
    fontMap("STSong") = "Times New Roman, Times, serif";
    fontMap("Symbol") = "Open Sans, sans-serif";
    fontMap("Tahoma") = "Arial, sans-serif";
    fontMap("Tamil MN") = "PT Sans Narrow, sans-serif";
    fontMap("Tamil Sangam MN") = "Balto, sans-serif";
    fontMap("Tekton Pro") = "Gravitas One, cursive";
    fontMap("Telugu MN") = "Arial, sans-serif";
    fontMap("Telugu Sangam MN") = "Arial, sans-serif";
    fontMap("Thonburi") = "Arial, sans-serif";
    fontMap("Times") = "Times New Roman, Times, serif";
    fontMap("Times New Roman") = "Times New Roman, Times, serif";
    fontMap("Trajan Pro") = "Times New Roman, Times, serif";
    fontMap("Trebuchet MS") = "Arial, sans-serif";
    fontMap("Tw Cen MT") = "Balto, sans-serif";
    fontMap("Verdana") = "Arial, sans-serif";
    fontMap("Webdings") = "Arial, sans-serif";
    fontMap("Wide Latin") = "Gravitas One, cursive";
    fontMap("Zapf Dingbats") = "Open Sans, sans-serif";
    fontMap("Zapfino") = "Gravitas One, cursive";
end
